#ifndef XYCONTROLGROUPBOX_H
#define XYCONTROLGROUPBOX_H
#include "XYControlWidget.h"
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSlider>
#include <QtWidgets/QLabel>
#include <QList>

class XYControlGroupBox : public QGroupBox
{
    Q_OBJECT
public:
    XYControlGroupBox(QWidget *parent = 0);
    void setupSpeedLevels(QList<double> levels);
    double speed();

public slots:
    void speedUp();
    void speedDown();
    void on_moveForward();
    void on_moveBackward();
    void on_moveLeft();
    void on_moveRight();

signals:
    void moveForward(double mmps);
    void moveBackward(double mmps);
    void moveLeft(double mmps);
    void moveRight(double mmps);
    void moveForwardStop();
    void moveBackwardStop();
    void moveLeftStop();
    void moveRightStop();
    void stop();

    void changeSpeed(double mmps);

private slots:
    void on_sliderValueChanged(int n);

private:
    void initSpeedLevels();
    void initContent();
    void initConnection();

private:
    QList<double> m_levels;

    QHBoxLayout *horizontalLayout;
    QVBoxLayout *verticalLayout;
    QSlider *verticalSliderSpeedXY;
    QLabel *labelSpeedXY;

    XYControlWidget * m_xyControl;
};

#endif // XYCONTROLGROUPBOX_H
